////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// Replication file for
// 
// Mitrea, Elena Cristina, Monika Mühlböck, and Julia Rita Warmuth: 
// “Extreme pessimists? Fear of socioeconomic decline and political attitudes”, 
// Political Behavior (forthcoming). 
//
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
//
// Unless stated otherwise, the article draws on the youth survey data from the CUPESSE project
//
// The full CUPESSE dataset can be downloaded from Gesis (ZA7475)
//
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
//
// When using the data, please cite the data as follows:
// 
// Tosun, Jale; Hörisch, Felix; Schuck, Bettina; Shore, Jennifer; Woywode, Michael; Strohmeyer, Robert; Kittel, Bernhard; Steiber, Nadia; Warmuth, Julia; Mühlböck, Monika; Lukes, Martin; Lorenc, Miroslav; Lorencová, Hana; Pauknerová, Daniela; Nový, Ivan; Jensen, Carsten; Arndt, Christoph; Littvay, Levente; Vegetti, Federico; Sata, Robert; Balea, Elena C.; Caserta, Maurizio; Boindo, Alessio E.; Reito, Francesco; Monteleone, Simona; Arco, José L.; Fernandez, Francisco; Hughes, Stephen; Carrillo, Francisco J.; Vancea, Mihaela; Jordana, Jacint; Freitag, Markus; Rapp, Carolin; Cemalcilar, Zeynep; Sümer, Nebi; Kamiloglu, Roza; Coskan, Canan; Maloney, William; Rainsford, Emily; Tsakloglou, Panos; Pierrakakis, Kyriakos; Christoforou, Asimina; Makantasi, Fay (2018): CUPESSE: Cultural Pathways to Economic Self-Sufficiency and Entrepreneurship. GESIS Data Archive, Cologne. ZA7475 Data file Version 1.0.0, doi:10.4232/1.13042
// 
////////////////////////////////////////////////////////////////////////////////////


// load data
use data_extreme_pessimists, clear
set more off


// Variables:
/*
YQ_country				country
YQ_leftright_0_10		left-right self-placement (0=left, 10=right)
YQ_modextremism_l0r		left-right exremism (calculated based on YQ_leftright_0_10; 0=extreme left, i.e. original values 0-2; 1=centrist; 2=extreme right, i.e. original values 8-10) 
YQ_extremism_abs		left-right exremism on a scale from 0 to 5 (calculated based on YQ_leftright_0_10; absolute difference to the center of the l-r scale of YQ_leftright_0_10) 
YQ_leftright_012		left-right exremism with different cut-off points (calculated based on YQ_leftright_0_10; 0=extreme left, i.e. original values 0-3; 1=centrist; 2=extreme right, i.e. original values 7-10) 
YQ_extremism_std1		left-right exremism standardized across countries (calculated based on YQ_leftright_0_10; for each country, the mean response was calculated; values more than one standard deviation (again calculated by country) below the country mean were coded “extremely left”, values more than one standard deviation above the mean were coded “extremely right”, all other values were coded as “centrist”)
YQ_expsocdec01			expected downward mobility (1=yes)
YQ_female				female (1=yes)
YQ_age					age (in years)
YQ_edu3					educational level (0 “low” equals ISCED I+II, 1 “medium” equals ISCED III+IV, and 2 “high” equals ISCED V)
YQ_empl012				occupation (in education/training, not working/unemployed, working)
YQ_belongrelig			religion (1=if belonging to a religion or denomination)
pop_density				population density of the NUTS2 area in which the individual lives (people/km²); data source: Eurostat, variables pjangroup and d3area for 2015
YQ_finsat				current economic situation (higher values indicate higher satisfaction with current situation)
YQ_ecoss				current economic self-sufficiency: index composed of different items(ability to pay one’s bills, afford extras, afford decent housing, put money in a savings account)
PWEIGHT_1				Post-stratification weights based on gender, age, education and NUTS2 region
weights_equal_country	Post-stratification weights proportional to within-country distributions of gender, age, education and NUTS2 region but with equal weight for each country in the sample
*/


// Table 1
// Multinomial logistic regression models with left-right self-placement (in three categories: extreme left, centrist, extreme right) of young adults as the dependent variable
mlogit YQ_modextremism_l0r YQ_expsocdec01 i.YQ_country [pweight=weights_equal_country], base(1)
mlogit YQ_modextremism_l0r YQ_expsocdec01 YQ_female YQ_age i.YQ_edu3 i.YQ_empl012 YQ_belongrelig pop_density YQ_finsat i.YQ_country [pweight=weights_equal_country], base(1)

// Table A.1
// Descriptive Statistics
svyset [pw=weights_equal_country]
foreach var of varlist YQ_leftright_0_10 YQ_age pop_density YQ_finsat YQ_ecoss {
sum `var'
svy: mean `var'
estat sd
}

foreach var of varlist YQ_modextremism_l0r YQ_expsocdec01 YQ_female YQ_edu3 YQ_empl012 YQ_belongrelig {
tab `var'
svy: tab `var'
}

// Table A.2
// Multinomial logistic regression models for individual countries with left-right self-placement of young adults as the dependent variable
bys YQ_country: mlogit YQ_modextremism_l0r YQ_expsocdec01 YQ_female YQ_age i.YQ_edu3 i.YQ_empl012 YQ_belongrelig pop_density YQ_finsat [pweight=PWEIGHT_1], base(1)

// Table A.3
// OLS regression models with extremism in left-right self-placement (absolute difference to the center of the l-r scale) of young adults as the dependent variable
reg YQ_extremism_abs YQ_expsocdec01 i.YQ_country [pweight=weights_equal_country]
reg YQ_extremism_abs YQ_expsocdec01 YQ_female YQ_age i.YQ_edu3 i.YQ_empl012 YQ_belongrelig pop_density YQ_finsat i.YQ_country [pweight=weights_equal_country]

// Table A.4
// Multinomial logistic regression models with left-right self-placement (in three categories: extreme left, centrist, extreme right – using different cut-off points than in the models in Table 1) of young adults as the dependent variable
mlogit YQ_leftright_012 YQ_expsocdec01 i.YQ_country [pweight=weights_equal_country], base(1)
mlogit YQ_leftright_012 YQ_expsocdec01 YQ_female YQ_age i.YQ_edu3 i.YQ_empl012 YQ_belongrelig pop_density YQ_finsat i.YQ_country [pweight=weights_equal_country], base(1)

// Table A.5
// Multinomial logistic regression models with standardized left-right self-placement (in three categories: extreme left, centrist, extreme right) of young adults as the dependent variable
mlogit YQ_extremism_std1 YQ_expsocdec01 i.YQ_country [pweight=weights_equal_country], base(1)
mlogit YQ_extremism_std1 YQ_expsocdec01 YQ_female YQ_age i.YQ_edu3 i.YQ_empl012 YQ_belongrelig pop_density YQ_finsat i.YQ_country [pweight=weights_equal_country], base(1)

// Table A.6
// Multinomial logistic regression models with left-right self-placement (in three categories: extreme left, centrist, extreme right) of young adults as the dependent variable and an index for economic self-sufficiency instead of the satisfaction with the current economic situation as the main control variable
mlogit YQ_modextremism_l0r YQ_expsocdec01 YQ_female YQ_age i.YQ_edu3 i.YQ_empl012 YQ_belongrelig pop_density YQ_ecoss i.YQ_country [pweight=weights_equal_country], base(1)


////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////

// save data in old stata format to read it in R

saveold "data_extreme_pessimists_old.dta", version(12)

////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////

